package beta;

import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

public class InputOut {
	
	public static void main(String[] args) throws IOException {
		byte[] b = {97, 65, 52};
		
		String s = "hello fileworld!";
		byte[] c = new byte[s.length()];
		for (int i=0; i<s.length(); i++) {
			c[i] = (byte) s.charAt(i);
		}
		
		FileOutputStream out = new FileOutputStream("test.txt");
		out.write(c);
		out.close();
		
		BufferedWriter out2 = new BufferedWriter(new FileWriter("test2.txt"));
		out2.write("hello fileworld!");
		out2.close();
	}
}
